﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RouterControl.WhsAddIn.SettingsControls
{
    public partial class EnableHijackingDetection : SettingsControlBase
    {
        public EnableHijackingDetection(RouterControlSettingsTab2 tab)
			: base(tab)
		{
			InitializeComponent();

			this.lineBox.Header.Text = Properties.Resources.txtSettingRouterHijackingDetection;
		}

        private void enableDetectionCB_CheckedChanged(object sender, EventArgs e)
        {
            // any change?
            if (this.enableDetectionCB.Checked == _tab.Settings.EnableRouterHijackingDetection)
                return;

            // save settings
            _tab.Settings.EnableRouterHijackingDetection = this.enableDetectionCB.Checked;

            _tab.Services.EnableSettingsApply();
        }

        private void EnableHijackingDetection_Load(object sender, EventArgs e)
        {
            // load settings
            this.enableDetectionCB.Checked = _tab.Settings.EnableRouterHijackingDetection;
        }
    }
}
